<template>
    <div id="app3">
        <header class="header">
            <div class="title">
                <!-- <router-link to="/xqda"> -->
                <img src="../../assets/images/01_11.png" alt="" class="img_zuo" @click="fanhui_btn" />
                <!-- </router-link> -->
                <div>{{ym_title}}</div>
            </div>
        </header>
        <div class="main">
            <div class="main_head">
                <span class="main_head_font">企业总数</span>
                <div class="font_prent" v-if="count_hu != null">
                    <div class="bg_font" v-if="count_hu.length>6">{{count_hu.slice(-7,-6)}}</div>
                    <div class="bg_font" v-else>0</div>
                    <div class="bg_font" v-if="count_hu.length>5">{{count_hu.slice(-6,-5)}}</div>
                    <div class="bg_font" v-else>0</div>
                    <div class="bg_font" v-if="count_hu.length>4">{{count_hu.slice(-5,-4)}}</div>
                    <div class="bg_font" v-else>0</div>
                    <div class="bg_font" v-if="count_hu.length>3">{{count_hu.slice(-4,-3)}}</div>
                    <div class="bg_font" v-else>0</div>
                    <div class="bg_font" v-if="count_hu.length>2">{{count_hu.slice(-3,-2)}}</div>
                    <div class="bg_font" v-else>0</div>
                    <div class="bg_font" v-if="count_hu.length>1">{{count_hu.slice(-2,-1)}}</div>
                    <div class="bg_font" v-else>0</div>
                    <div class="bg_font" v-if="count_hu.length>0">{{count_hu.slice(-1)}}</div>
                    <div class="bg_font" v-else>0</div>

                </div>
                <div class="main_head_ditu" @click="ditu_btn">
                    <img src="../../assets/images/dw_1.png" alt="" class="img_dt">
                    <span class="font_36">地图></span>
                </div>
            </div>

            <div class="hr_s">
                <div class="hr"></div>
            </div>
            <div class="main_fool">
                <div>
                    <div class="main_fool_title">巡查排查</div>
                    <div class="xcpc_prent">
                        <div id="zx_tu" ref="zx_tu"></div>
                    </div>
                </div>
                <div class="main_fool_su"></div>
                <div>
                    <div class="main_fool_title">
                        <span>隐患走势</span>
                        <div class="main_fool_title_right">
                            <div class="yh_icon">
                                <div></div>
                                <span>&nbsp;隐患</span>
                            </div>
                            &nbsp;&nbsp;
                            <div class="yzg_icon">
                                <div></div>
                                <span>&nbsp;已整改</span>
                            </div>
                        </div>
                    </div>
                    <div class="yhzs_prent">
                        <div id="zz_tu" ref="zz_tu"></div>
                    </div>
                </div>
            </div>
            <div class="hr_s">
                <div class="hr"></div>
            </div>
            <div class="mian_list mian_list_sq" v-show="sq_list_show">
                <!--<van-pull-refresh v-model="refreshing" @refresh="onRefresh">-->
                  <van-list v-model="loading" :finished="finished" @load="onLoad">
                    <div class="lie_list_item" v-for="(obj,i) of sq_list" @click="openXq(obj)">
                      <div class="xh">{{i+1}}</div>
                      <div class="name">{{jiequDz(obj.enterpriseName,6,'…')}}</div>
                      <div class="people">{{jiequDz(obj.enterprisePerson,4,'…')}}</div>
                      <div class="tel">{{obj.personPhone}}</div>
                      <div v-show="!(obj.personPhone||obj.personPhone===0)" class="dianhua"></div>
                      <img v-show="obj.personPhone||obj.personPhone===0" src="../../assets/images/tel.png" alt="" class="dianhua" @click.stop="tel(obj)" />
                    </div>
                  </van-list>
                <!--</van-pull-refresh>-->

            </div>
            <div class="mian_list" v-show="!sq_list_show">
                <div v-for="(item, index) in items" :key="index" v-show="item.jc!='竹木街社区'">
                    <div :class="{'item':true,'item_active':items.length-1==index || items.length%2==0&&items.length-2==index }"
                        @click="btn_h(item.id,item.count,item.lev,item.jc)">
                        <div>{{item.jc}}</div>
                        <div>{{item.count}} 户</div>
                    </div>
                </div>

            </div>
        </div>
        <Tabbar></Tabbar>
    </div>
</template>
<script>
    import { Dialog } from 'vant';
    import Tabbar from "../tabbar.vue";
    import echarts from "echarts"
    export default {
        name: "tj_tu_4",
        data() {
            return {
                menuFlag: false,
                userId: null,
                items: [],

                data_zxt: [],
                data_zxt_month: [],
                data_zxt_value: [],
                data_zzt: [],
                yue: null,
                data_zzt_month: [],
                data_zzt_value: [],
                data_zzt_value1: [],
                list_id: "",
                count_hu: null,
                ym_title: "",
                is_jd: false,
                list_path_canshu: [],
                ct_cunt: 0,
                sehqu_id: null,

                dwId: '',
                lev: '',

                sq_list_show: [],
                sq_list: [],
                sq_sqid: null,
                sq_page: 1,
                sq_pageSize: 50,
                loading: false,
                finished: false,
                refreshing: false,
                load_over: false,
                chooseId:0,
                cx_bm:false
            }
        },
        components: {
            Tabbar
        },
        methods: {
            dateLocation () {
              let month = {
                start: 0,
                end: 0
              };
              // if (mouths <= 12) {
                month.start = (100/12)*(new Date().getMonth() + 1 - 3)
                month.end = (100/12)*(new Date().getMonth() + 1)
              // } else {
              //   month.start = (100/30)*(new Date().getDate() - 7)
              //   month.end = (100/30)*(new Date().getDate() - 1)
              // }
              return month
            },
            fanhui_btn() {
                console.log("返回", this.ct_cunt)
                this.$router.back()

            },
            info() {//获取数据
                try {
                    plus.nativeUI.showWaiting("正在加载...");
                } catch (e) {
                    console.log('plus问题');
                }
                this.axios
                    .post(
                        `${this.$global_msg.Url.host}/enterprise/qyList?userId=${this.userId}&type=0`
                    )
                    .then(res => {
                        console.log(res);
                        if (res.data.code == 0) {
                            this.data_zxt_month = []
                            this.data_zxt_value = []
                            this.data_zzt_month = []
                            this.data_zzt_value = []
                            this.data_zzt_value1 = [];
                            this.count_hu = res.data.rows.count+""

                            this.dwId = res.data.rows.dwId;
                            this.lev = res.data.rows.lev;
                            // 列表
                            this.items = res.data.rows.maps1;
                            if(res.data.rows.maps1&&res.data.rows.maps1.length>0){
                              res.data.rows.maps1.forEach(element => {
                                  this.list_id += "," + element.id
                              });
                              this.list_id = this.list_id.substring(1)
                            }else{
                              this.list_id = '';
                            }
                            // console.log(this.list_id)
                            // 巡查排查折线图
                            // this.data_zxt_month=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]
                            var data_zxt_value = [0,0,0,0,0,0,0,0,0,0,0,0];
                            res.data.rows.xcpc.forEach((v, index) => {
                              data_zxt_value[v.momth-1] = v.count;
                            })
                            this.data_zxt_value = data_zxt_value;

                            // this.data_zxt = res.data.rows.mapOne.patrol

                            // this.data_zxt = this.data_zxt.sort(this.sequence).reverse()
                            // this.data_zxt.forEach(element => {
                            //     this.data_zxt_month.push(element.month)
                            //     this.data_zxt_value.push(element.value)
                            // });
                            // 柱状图 已整改
                            var data_zzt_value = [0,0,0,0,0,0,0,0,0,0,0,0];
                            res.data.rows.yzg.forEach((v, index) => {
                              data_zzt_value[v.momth-1] = v.count;
                            })
                            this.data_zzt_value = data_zzt_value;

                            // 柱状图 隐患
                            var data_zzt_value1 = [0,0,0,0,0,0,0,0,0,0,0,0];
                            res.data.rows.yh.forEach((v, index) => {
                              data_zzt_value1[v.momth-1] = v.count;
                            })
                            this.data_zzt_value1 = data_zzt_value1;

                            // this.data_zzt = res.data.rows.mapOne.troublel
                            // this.data_zzt = this.data_zzt.sort(this.sequence).reverse()
                            // this.data_zzt.forEach(element => {
                            //     this.data_zzt_month.push(element.month)
                            //     this.data_zzt_value.push(element.value)
                            // });
                            console.log("折线图数据", this.data_zxt_value);
                            for(var n=0;n<this.data_zxt_value.length;n++){
                              if((n+1)>this.yue){
                                this.data_zxt_value[n] = null;
                              }
                            }
                            console.log("折线图数据切割", this.data_zxt_value);
                            this.zhexiantu();
                            this.zhuzhuangtu();
                            this.ym_title = localStorage.getItem('Title') + '企业';

                            if(res.data.rows.userInfoVo&&res.data.rows.userInfoVo.dwlxid==100&&res.data.rows.userInfoVo.lev==2){
                              this.chooseId = 1;
                              this.showShequList({id:res.data.rows.userInfoVo.fid});
                            }else{
                              this.chooseId = 0;
                              if (res && res.data && res.data.rows && res.data.rows.maps1) {
                                if(res.data.rows.maps1.length == 1 && res.data.rows.maps1[0].lev===2){
                                  this.showShequList(res.data.rows.maps1[0]);
                                }else{
                                  this.showShequList(null);
                                }
                              } else {
                                var obj = {
                                  id:res.data.rows.user.dwid,
                                  dwlxid:res.data.rows.user.dwlxid
                                };
                                this.showShequList(obj);
                                this.list_id = res.data.rows.user.dwid;
                              }
                            }

                            try {
                                plus.nativeUI.closeWaiting();
                            } catch (e) {
                                console.log('plus问题');
                            }
                        } else {
                            this.$toast('服务器数据异常!');
                        }

                    }).catch(function (error) {
                        console.log(error);
                        this.$terminal._error(error);
                        plus.nativeUI.closeWaiting();
                        // alert("获取类型接口异常")

                    });
            },
            showShequList(item) {
                console.log(item);
                if (item) {
                    this.sq_list_show = true;
                    this.sq_sqid = item.id;
                    this.sq_page = 1;
                    if(item.dwlxid==100){
                      this.cx_bm = true;
                    }else{
                      this.cx_bm = false;
                    }
                    this.load_over = true;
                    this.refreshing = true;
                    this.onRefresh();
                } else {
                    this.sq_list_show = false;
                    this.sq_sqid = null;
                    this.sq_list = [];
                    this.sq_page = 1;
                    this.load_over = false;
                    this.cx_bm = false;
                }
            },
            onLoad() {
                var _this = this;
                if (_this.refreshing) {
                    _this.sq_list = [];
                    _this.refreshing = false;
                    _this.sq_page = 1;
                }
                if (!_this.load_over) {
                    _this.loading = false;
                    _this.finished = true;
                    _this.refreshing = false;
                    return;
                }

                /*try{
                  plus.nativeUI.showWaiting("正在加载...");
                }catch(e){
                  console.log(e.message);
                }*/
                var params = {
                    page: _this.sq_page,
                    pageSize: _this.sq_pageSize,
                    type:_this.chooseId
                };
                if(_this.cx_bm){
                  params.streetId = _this.sq_sqid;
                }else{
                  if(_this.chooseId===1||_this.chooseId==='1'){
                     params.streetId = _this.sq_sqid;
                  }else{
                    params.communityId = _this.sq_sqid;
                  }
                }
                _this.axios.get(_this.$global_msg.Url.host + "/enterprise/selectEnterpriseByVague", {
                    params: params
                }).then(function (data) {
                    console.log('/enterprise/selectEnterpriseByVague:', data);
                    if (data && data.data) {
                        if (data.data.code == 0) {
                            _this.sq_list = _this.sq_list.concat(data.data.rows);
                            if (_this.sq_list.length >= data.data.total) {
                                _this.finished = true;
                            } else {
                                _this.sq_page++;
                            }
                        } else {
                            _this.$toast(data.data.msg);
                        }
                    } else {
                        _this.$toast('查询失败');
                    }
                    _this.loading = false;

                    try {
                        plus.nativeUI.closeWaiting();
                    } catch (e) {
                        console.log(e.message);
                    }
                }).catch(error => {
                  _this.$terminal._error(error);
                });
            },
            onRefresh() {
                // 清空列表数据
                this.finished = false;

                // 重新加载数据
                // 将 loading 设置为 true，表示处于加载状态
                this.loading = true;
                this.onLoad();
            },
            jiequDz(dz, num,str) {
                if (dz.length > num) {
                    dz = dz.substring(0, num)+str;
                }
                return dz;
            },
            openXq(obj) {//打开详情查看
                console.log(obj);
                var _this = this;
                var xqda_params = {
                    xq_id: obj.id,//详情id
                    from: '/qiye_ti_tu_3'//详情返回路径
                };
                localStorage.setItem("xqda_params", JSON.stringify(xqda_params));
                localStorage.setItem("list_scrollTop3", $('#app3').scrollTop());
                this.$router.push("/qy_see");
            },
            tel(obj) {
                var _this = this;
                var phone = (obj.personPhone || obj.personPhone === 0) ? obj.personPhone : '';
                if (phone.toString().length >= 1) {
                    Dialog.confirm({
                        title: '提示',
                        message: '是否拨打 ' + phone + ' ？',
                        confirmButtonText: "拨打", //改变确认按钮上显示的文字
                        cancelButtonText: "取消" //改变取消按钮上显示的文字
                    }).then(() => {
                        //console.log("点击了确认按钮噢")
                        plus.device.dial(phone, false);
                    }).catch(() => {
                        //console.log("点击了取消按钮噢")
                    });
                }
            },
            btn_h(dwId, count,lev, name) {//点击列表
                if (lev===1) {
                    this.ct_cunt = 1
                    this.sehqu_id = dwId
                    this.list_path_canshu[0] = { "id": dwId, "count": count,"lev":lev, "jc": name }
                    // console.log(this.list_path_canshu)
                } else if (lev===2) {
                    var xqda_params = {
                        path: '/qiye_ti_tu_3',//列表或地图页面返回的路径
                        cs_cx: {//列表或地图页面查询参数
                            communityId: dwId
                        },
                        title: name
                    };
                    localStorage.setItem("xqda_params", JSON.stringify(xqda_params));
                    localStorage.setItem("list_scrollTop3", $('#app3').scrollTop());
                    sessionStorage["tongji_ct_cunt"] = this.ct_cunt
                    sessionStorage["tongji_list_path_canshu"] = JSON.stringify(this.list_path_canshu)
                    this.$router.push({
                        path: '/mode_list_qy'
                    })
                    return;
                }
                // console.log(this.list_path_canshu)
                console.log(name)
                localStorage.setItem('name', name)
                console.log(count)
                try {
                    plus.nativeUI.showWaiting("正在加载...");
                } catch (e) {
                    console.log('plus问题');
                }

                this.axios
                    .post(
                        `${this.$global_msg.Url.host}/enterprise/XjList?dwId=${dwId}&lev=${lev}`
                    )
                    .then(res => {
                        console.log(res)
                        if (res.data.code == 0) {
                            console.log(name)
                            this.count_hu = count+""
                            this.dwId = dwId;
                            this.lev = lev;
                            this.ym_title = name
                            this.list_id = dwId
                            // this.items=[]
                            if (lev!==2) {
                                this.items = res.data.rows.maps1;
                            }
                            let a = []
                            this.data_zxt_value = [];
                            this.data_zzt_value = [];
                            this.data_zzt_value1 = [];


                            // 折线图
                            var data_zxt_value = [0,0,0,0,0,0,0,0,0,0,0,0];
                            res.data.rows.xcpc.forEach((v, index) => {
                              data_zxt_value[v.momth-1] = v.count;
                            })
                            this.data_zxt_value = data_zxt_value;

                            // 柱状图 已整改
                            var data_zzt_value = [0,0,0,0,0,0,0,0,0,0,0,0];
                            res.data.rows.yzg.forEach((v, index) => {
                              data_zzt_value[v.momth-1] = v.count;
                            })
                            this.data_zzt_value = data_zzt_value;

                            // 柱状图 隐患
                            var data_zzt_value1 = [0,0,0,0,0,0,0,0,0,0,0,0];
                            res.data.rows.yh.forEach((v, index) => {
                              data_zzt_value1[v.momth-1] = v.count;
                            })
                            this.data_zzt_value1 = data_zzt_value1;

                            console.log("折线图数据", this.data_zxt_value);
                            for(var n=0;n<this.data_zxt_value.length;n++){
                              if((n+1)>this.yue){
                                this.data_zxt_value[n] = null;
                              }
                            }
                            console.log("折线图数据切割", this.data_zxt_value);
                            this.zhexiantu()
                            this.zhuzhuangtu()

                            try {
                                plus.nativeUI.closeWaiting();
                            } catch (e) {
                                console.log('plus问题');
                            }
                        } else {
                            this.$toast('服务器数据异常!');
                        }
                    }).catch(error => {
                      this.$terminal._error(error);
                    });


            },
            zhexiantu() {//折线图
                var that = this;
                // var myChart_zx = echarts.init(document.getElementById("zx_tu"));
                let a = this.$refs.zx_tu
                var max = null;
                if (Math.max.apply(null, this.data_zxt_value) < 10) {
                    max = 10;
                }
                if (a) {
                    let myChar = echarts.init(a)
                    var option = {
                        color: ['#3398DB'],
                        grid: {
                            left: '3%',
                            right: '10%',
                            bottom: '0%',
                            top: '27%',
                            containLabel: true
                        },
                        dataZoom: [
                            //X轴内置滑动
                            {
                                type: 'inside',  //内置滑动，随鼠标滚轮展示
                                xAxisIndex: [0],
                                // minSpan:40,
                                // maxSpan:50,
                                start: that.dateLocation().start,//初始化时，滑动条宽度开始标度
                                end: that.dateLocation().end //初始化时，滑动条宽度结束标度
                            }],
                        xAxis: [
                            {
                                type: 'category',
                                //  name : '年',
                                // boundaryGap: false,
                                default: false,
                                // data: this.data_zxt_month,
                                data: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
                                axisLabel: {
                                    show: true,
                                    interval: 0,//设置间隔
                                    textStyle: {
                                        color: '#535353',//字体颜色,
                                        fontSize: 12,
                                    },
                                },
                                axisTick: {
                                    show: false,//取消刻度尺

                                },
                                axisLine: {
                                    show: false,
                                    // lineStyle: {
                                    //     color: '#33a6d2',
                                    //     width:2,
                                    // }
                                }
                            }
                        ],
                        yAxis: [
                            {
                                name: '家次',
                                type: 'value',
                                boundaryGap: true,
                                nameLocation: "end",
                                max: max,
                                splitLine: {
                                    // show: false//隐藏横线
                                    lineStyle: {
                                        color: '#DFDFDF',
                                        width: 2,
                                    }
                                },
                                axisLabel: {
                                    show: true,
                                    interval: 0,//设置间隔
                                    textStyle: {
                                        color: '#535353',//字体颜色
                                        fontSize: 12,
                                    },
                                },
                                axisTick: {
                                    interval: 0,
                                    alignWithLabel: true,
                                    show: false,//取消刻度尺
                                },
                                axisLine: {
                                    show: false,//取消刻度尺
                                    // lineStyle: {
                                    //     color: '#33a6d2'//坐标线颜色
                                    // }
                                }
                            }
                        ],
                        series: [
                            {
                                name: '2019年',
                                type: 'line',
                                // smooth: true,//曲线
                                //  stack: '亩',
                                // symbol: "none",//去圆点
                                itemStyle: {
                                    normal: {
                                        label: {
                                          show: true,
                                          position: 'top',
                                          textStyle: {
                                            color: 'black',
                                            fontSize: 12
                                          }
                                        },
                                        lineStyle: {
                                            color: '#00A0E9',//线颜色
                                            width: 2,//线宽
                                        }
                                    }
                                },
                                data: this.data_zxt_value
                            }
                        ]
                    };
                    myChar.setOption(option);
                }
            },
            zhuzhuangtu() {//柱状图
                var that = this;
                // var myChart_zz = echarts.init(document.getElementById("zz_tu"));
                let a = this.$refs.zz_tu
                var max = null;
                if (Math.max.apply(null, this.data_zzt_value) > Math.max.apply(null, this.data_zzt_value1)) {
                    if (Math.max.apply(null, this.data_zzt_value) > 10) {
                        max = null
                    } else {
                        max = 10;
                    }
                } else {
                    if (Math.max.apply(null, this.data_zzt_value1) > 10) {
                        max = null
                    } else {
                        max = 10;
                    }
                }
                if (a) {
                    let myChar = echarts.init(a)
                    var option = {
                        color: ['#3398DB'],
                        grid: {
                            left: '3%',
                            right: '10%',
                            bottom: '0%',
                            top: '27%',
                            containLabel: true
                        },
                        dataZoom: [
                            //X轴内置滑动
                            {
                                type: 'inside',  //内置滑动，随鼠标滚轮展示
                                xAxisIndex: [0],
                                //   filterMode:'empty',
                                // minSpan:40,
                                // maxSpan:50,
                                start: that.dateLocation().start,//初始化时，滑动条宽度开始标度
                                end: that.dateLocation().end   //初始化时，滑动条宽度结束标度
                            }],
                        xAxis: [
                            {
                                type: 'category',
                                // data: this.data_zzt_month,
                                data: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
                                axisTick: {
                                    show: false,//取消刻度尺
                                },
                                axisLabel: {
                                    show: true,
                                    interval: 0,//设置间隔
                                    textStyle: {
                                        color: '#535353',//字体颜色,
                                        fontSize: 12,
                                    },
                                },
                                axisLine: {
                                    show: false,
                                }
                            }
                        ],
                        yAxis: [
                            {
                                name: '个',
                                type: 'value',
                                max: max,
                                splitLine: {
                                    // show: false//隐藏横线
                                    lineStyle: {
                                        color: '#DFDFDF',
                                        width: 2,
                                    }
                                },
                                axisLabel: {
                                    show: true,
                                    textStyle: {
                                        color: '#535353',//字体颜色
                                        fontSize: 12,
                                    },
                                },
                                axisTick: {
                                    show: false,//取消刻度尺
                                },
                                axisLine: {
                                    show: false,//取消刻度尺
                                }
                            }
                        ],

                        series: [
                            {
                                // name: '直接访问',
                                color: "#FD3F3F",
                                type: 'bar',
                                // barGap: 0,
                                barWidth: '30%',
                                data: this.data_zzt_value1,//隐患
                                itemStyle: {
                                  normal: {
                                    label: {
                                      show: true,
                                      position: 'top',
                                      textStyle: {
                                        color: '#000',
                                        fontSize: 12
                                      }
                                    }
                                  }
                                }
                            },
                            {
                                // name: '直接访问',
                                type: 'bar',
                                barWidth: '30%',
                                data: this.data_zzt_value,
                                itemStyle: {
                                  normal: {
                                    label: {
                                      show: true,
                                      position: 'top',
                                      textStyle: {
                                        color: '#000',
                                        fontSize: 12
                                      }
                                    }
                                  }
                                }
                            }
                        ]
                    };
                    myChar.setOption(option);
                }
            },
            sequence(a, b) {//排序
                if (a.id > b.id) {
                    return -1;
                } else if (a.id < b.id) {
                    return 1
                } else {
                    return 0;
                }
            },
            ditu_btn() {
                var xqda_params = {
                    path: '/qiye_ti_tu_3',//列表或地图页面返回的路径
                    cs_cx: {//列表或地图页面查询参数
                        dwId: this.list_id
                    },
                    cx_type: 'qy'
                };
                if (this.ym_title != (localStorage.getItem('Title') + '企业')) {
                    xqda_params.title = this.ym_title;
                }
                localStorage.setItem("xqda_params", JSON.stringify(xqda_params));
                sessionStorage["tongji_ct_cunt"] = this.ct_cunt
                sessionStorage["tongji_list_path_canshu"] = JSON.stringify(this.list_path_canshu)
                this.$router.push({
                    path: '/mode_map'
                })
            },
        },
        beforeRouteLeave(to, from, next) {
            Dialog.close();
            next();
        },
        //进入该页面时，用之前保存的滚动位置赋值
        beforeRouteEnter(to, from, next) {
            next(vm => {
                var list_scrollTop3 = localStorage.getItem("list_scrollTop3") ? JSON.parse(localStorage.getItem("list_scrollTop3")) : null;
                if (list_scrollTop3 || list_scrollTop3 === 0) {
                    $('#app3').animate({ scrollTop: list_scrollTop3 }, 0);
                    var list_update = localStorage.getItem("list_update") ? JSON.parse(localStorage.getItem("list_update")) : null;
                    if (list_update) {
                        var list = vm.sq_list;
                        vm.list = [];
                        for (var n = 0; n < list.length; n++) {
                            if (list[n].id == list_update.id) {
                                list[n] = list_update;
                            }
                        }
                        vm.sq_list = list;
                        vm.$forceUpdate();
                    }
                } else {
                    vm.userId = localStorage.getItem("userId")//获取访问id
                    vm.ym_title = localStorage.getItem('Title') + '企业';
                    vm.yue = new Date().getMonth() + 1

                    vm.list_path_canshu = JSON.parse(sessionStorage.getItem("tongji_list_path_canshu"))
                    vm.ct_cunt = JSON.parse(sessionStorage.getItem("tongji_ct_cunt"))
                    if (vm.ct_cunt == 2) {
                        vm.btn_h(vm.list_path_canshu[1].id, vm.list_path_canshu[1].count, vm.list_path_canshu[1].lev, vm.list_path_canshu[1].jc)
                    } else if (vm.ct_cunt == 1) {
                        vm.btn_h(vm.list_path_canshu[0].id, vm.list_path_canshu[0].count, vm.list_path_canshu[0].lev, vm.list_path_canshu[0].jc)
                    } else if (vm.ct_cunt == 0) {
                        vm.info()
                    }
                }
                localStorage.removeItem("list_scrollTop3");
                localStorage.removeItem("list_update");
                localStorage.removeItem("xqda_params");
            })
        },
        mounted() {
            var _this = this;
            //物理返回
            // window.addEventListener("popstate", function(){
            //   _this.fanhui_btn();
            // }, false);
        },
        beforeCreate() {
            document.addEventListener("plusready", this.plusReady, false);
        },
        created() {

        },
    };
</script>
<style scoped>
    * {
        box-sizing: border-box;
    }

    .header {
        height: 1.8519rem;
        background: #007aff;
        padding-top: 0.8333rem;
        box-sizing: border-box;
        position: fixed;
        width: 100%;
        top: 0;
        z-index: 20;
        font-size: 0.388888rem;
    }

    .title {
        padding: 0 0.3704rem;
        display: flex;
        align-items: center;
        color: #fff;
    }

    .title>div {
        width: 100%;
        font-size: 0.4444rem;
        text-align: center;
    }

    .img_zuo {
        width: 0.2593rem;
        height: 0.463rem;
    }

    .btn-add {
        position: absolute;
        right: 0.37037rem;
        font-size: 1.111111rem !important;
    }

    .btn-search {
        position: absolute;
        right: 1.388888rem;
        bottom: 0.388888rem;
        width: 0.629629rem;
        height: 0.629629rem;
    }

    .btn-change {
        position: absolute;
        left: 1.537037rem;
        font-size: 0.388888rem;
        bottom: 0.444444rem;
    }

    /*  */

    .main {
        padding-top: 1.8519rem;
        /* height: 100vh; */
        box-sizing: border-box;
        background: #fff;
        padding-bottom: 1.6667rem;
        /* padding-top: 10.0008px; */
    }

    .main_head {
        height: 1.3889rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 0.3704rem;
    }

    .img_dt {
        width: 0.3148rem;
        height: 0.4259rem;
        margin-right: 0.0556rem;
    }

    .main_head_ditu {
        display: flex;
        align-items: center;
        color: #4568FF;
        font-size: 0.3889rem;
        /* margin-right: 0.3704rem; */
    }

    .main_head_font {
        font-size: 0.4444rem;
        font-weight: 400;
    }

    .font_36 {
        font-size: 0.3333rem;
    }

    .font_36_huise {
        font-size: 0.3333rem;
        color: #8E8E8E;
        margin-top: 0.1852rem;
        width: 100%;
        padding-left: 0.5rem;
    }

    .font_42 {
        font-size: 0.3889rem;
    }

    /* 圆饼图 */
    .main_center {
        display: flex;
        align-items: center;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .main_center>div.main_center_item {
        width: 3.3333rem;
        height: 3.3333rem;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: end;
        padding: 0.3704rem 0;
        padding-left: 0.7407rem;
        box-sizing: border-box;
    }

    #bingtu {
        width: 3.3333rem;
        height: 3.3333rem;
    }

    .main_center_fool {
        width: 100%;
        display: flex;
    }

    .main_center_fool>div {
        width: 3.3333rem;
        height: 1.6667rem;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        padding-left: 0.7407rem;
    }

    .su {
        width: 0.1296rem;
        height: 0.463rem;
        border-radius: 1.8519rem;
        background: #238BFF;
        display: inline-block;
        margin-right: 0.3704rem;
    }

    .su_1 {
        background: #238BFF;
    }

    .su_2 {
        background: #23C9FF;
    }

    .su_3 {
        background: #FFD548;
    }

    .su_4 {
        background: #7264F9;
    }

    .su_5 {
        background: #B164F9;
    }

    .su_6 {
        background: #64F99C;
    }

    .su_7 {
        background: #DDDDDD;
    }

    .b_c_1 {
        background: #6000ff !important;
    }

    .b_c_2 {
        background: #ffa800 !important;
    }

    .b_c_3 {
        background: #08d86a !important;
    }

    .b_c_4 {
        background: #238bff !important;
    }

    .b_c_5 {
        background: #8402b4 !important;
    }

    .b_c_6 {
        background: #ee48d9 !important;
    }

    .b_c_7 {
        background: #007022 !important;
    }

    .b_c_8 {
        background: #303030 !important;
    }

    .b_c_9 {
        background: #48c5ee !important;
    }

    .b_c_10 {
        background: #9d9802 !important;
    }

    .su_prent {
        display: flex;
        align-items: center;
    }

    .hr_s {
        padding: 0 0.3704rem;
    }

    .hr {
        width: 100%;
        height: 0.3704rem;
        background: #F7F7F7;
        box-sizing: border-box;
    }

    /* 折线图 柱张图 */
    .main_fool {
        width: 100%;
        height: 4.6296rem;
        padding: 0 0.3704rem;
        display: flex;
        box-sizing: border-box;
        align-items: center;
        justify-content: space-between;
    }

    .yhzs_prent {
        width: 4.296rem;
        height: 3.7037rem;
        overflow-x: hidden;
        /* padding-right: 0.1852rem; */
    }

    #zx_tu {
        width: 4.296rem;
        height: 3.7037rem;
    }

    .main_fool>div {
        width: 48%;
    }

    .main_fool_title {
        font-size: 0.3889rem;
        font-weight: 400;
        /* margin-top: 0.2593rem; */
        /* margin-left: 5%; */
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .main_fool_title_right {
        display: flex;
        align-items: center;
    }

    .yh_icon,
    .yzg_icon {
        display: flex;
        align-items: center;
    }

    .yh_icon>span,
    .yzg_icon>span {
        font-size: 0.2222rem;
        font-weight: 400;
    }

    .yh_icon>div:first-child {
        width: 0.3704rem;
        height: 0.1481rem;
        background: #FD3F3F;
    }

    .yzg_icon>div:first-child {
        width: 0.3704rem;
        height: 0.1481rem;
        background: #3398DB;
    }

    /* 柱状图 */
    .xcpc_prent {
        width: 4.296rem;
        height: 3.7037rem;
        overflow-x: hidden;
        /* padding-right: 0.1852rem; */
    }

    #zz_tu {
        width: 4.296rem;
        height: 3.7037rem;
    }

    .main_fool_su {
        width: 1px !important;
        height: 3.6111rem;
        border-right: 1Px solid #ddd;
    }

    .mian_list {
        width: 100%;
        display: flex;
        padding: 0.2778rem 0;
        flex-wrap: wrap;
    }

    .mian_list>div {
        width: 50%;
        padding-left: 0.3704rem;
        padding-right: 0.1852rem;
        box-sizing: border-box;
        border-right: 1Px solid #ddd;
    }

    .mian_list>div:nth-child(2n) {
        border-right: none;
        padding-left: 0.1852rem;
    }

    .item {
        display: flex;
        justify-content: space-between;
        padding-left: 0.3704rem;
        padding-right: 0.1852rem;
        box-sizing: border-box;
        border-bottom: 1Px solid #ddd;
        /* border-top: 1Px solid #ddd; */
        margin-bottom: -1Px;
        height: 1.3889rem;
        align-items: center;
    }

    .item>div {
        font-size: 0.3333rem;
    }

    .item_active {
        border: none;
    }

    #app3 {
        width: 100%;
        height: 100%;
        position: fixed;
        top: 0;
        left: 0;
        overflow-y: scroll;
    }

    /*社区显示的列表*/
    .mian_list_sq div {
        width: 100%;
    }

    .lie_list_item {
        height: 1.37037rem;
        border-bottom: 0.018518518518518517rem solid #f1f1f1;
        display: flex;
        align-items: center;
    }

    .lie_list_item .xh{
    	width: 0.8rem;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .lie_list_item .name{
    	flex: 1;
      height: 100%;
      display: flex;
      align-items: center;
      font-size: 0.388888rem;
    }
    .lie_list_item .tel{
    	width: 2.5rem;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      font-size: 0.388888rem;
      margin-left: 0.185185rem;
      margin-right: 0.185185rem;
    }
    .lie_list_item .people{
      width: 2rem;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      font-size: 0.388888rem;
      margin-left: 0.185185rem;
    }
    .lie_list_item .dianhua{
    	width: 0.518518rem;
      height: 0.518518rem;
      margin-right: 0.185185rem;
    }

    .lie_list_item_bg {
        background: #2E5DFE;
        color: #fff;
    }
    .font_prent{
        display: flex;
        justify-content: center;
    }
    @font-face {
			font-family: 'Jingti';
			src: url('../../assets/css/digifacewide.ttf');
		}
    .bg_font {
        /* width: 0.5556rem; */
        padding: 0 0.0926rem;
        text-align: center;
        color: #53FF57;
        /* height: 100%; */
        font-family: "Jingti";
        font-size: 0.3889rem;
        margin-left: 0.0741rem;
        /* line-height: 1.3889rem; */
        transform: scale(1, 1.5);
        -ms-transform: scale(1, 1.5);
        -webkit-transform: scale(1, 1.5);
        -moz-transform: scale(1, 1.5);
        -o-transform: scale(1, 1.5);
        background-image: url("../../assets/images/shijian_bg.png");
        background-size: 100% 100%;

    }
</style>
